<template>
	<div class="task-info-warp">
		<div class="list-container bg-white" :class="[exception?'exception':'']">

			<div class="content">
				<slot></slot>
				<div class="exception-tip" v-if="exception">
					<span class="">
						<image class="image-icon-md error-icon" src="@/static/icons/icon-exception.png"></image>
					</span>
					<slot name="error"></slot>
				</div>
			</div>

			<div class="card-title">
				<div class="title-warp">

					<div class="prefix">
						<div class="icon">
							<slot name="icon"></slot>
						</div>
						<div>
							<slot name="title"></slot>
						</div>
					</div>

					<div class="suffix text-grey-300">
						<slot name="progress"></slot>
					</div>

				</div>

			</div>
		</div>
	</div>
</template>

<script>
	export default {
		name: "TaskInfoCard",
		props: {
			exception: {
				type: Boolean,
				default: false
			},
		},
	}
</script>

<style lang="scss" scoped>
	.task-info-warp {
    margin:12rpx 0;

		.list-container {
			margin: 15rpx 25rpx;
			overflow: hidden;
			border-radius: 15rpx;
			border: 1px white solid;

			&.exception {
				background: rgb(255, 239, 239);
				background: linear-gradient(180deg, rgba(255, 239, 239, 1) 0%, rgba(255, 255, 255, 1) 100%);
				border: 1px #ff9999 solid;
			}

			.card-title {
				border-top: 1px #e3e3e3 solid;

				.title-warp {
					display: flex;
					flex-direction: row;
					align-items: center;
					justify-content: space-between;
					padding: 12rpx 22rpx;
          font-size: 28rpx;
          color: #7f7f7f;
					.prefix {
						display: flex;
						flex-direction: row;
						align-items: center;


						.icon {
							position: relative;
							top: 3px;
							margin-right: 8rpx;
						}

					}

				}
			}

			.content {
				min-height: 32rpx;
				padding: 18rpx 22rpx;
        font-size: 30rpx;
        color: #7f7f7f;

				.exception-tip {
					display: flex;
					flex-direction: row;
					align-items: center;
					color: #ff1c1f;
					font-weight: 600;

					.error-icon {
						position: relative;
						top: 3px;
						margin-right: 12rpx;
					}
				}
			}

		}

	}
</style>
